package cn.amos.mvc.common.ip;

import com.alibaba.fastjson.JSON;

import java.io.Serializable;

/**
 * PROJECT: gateway
 * DESCRIPTION: note
 *
 * @author Daoyuan
 * @date 2019/1/19
 */
public class ServerMessageVO implements Serializable {
    private static final long serialVersionUID = 8660348663027909946L;

    /**
     * 端口号
     */
    private Integer port;
    /**
     * ip
     */
    private String host;
    /**
     * 用户名
     */
    private String user;
    /**
     * 密码
     */
    private String password;

    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public String getUser() {
        return user;
    }

    public void setUser(String user) {
        this.user = user;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }

    public static void main(String[] args) {
        ServerMessageVO serverMessageVO = new ServerMessageVO();
        serverMessageVO.setHost("47.106.227.226");
        serverMessageVO.setPort(22);
        serverMessageVO.setUser("root");
        serverMessageVO.setPassword("Dyt19951014");
        String serverMessage = JSON.toJSONString(serverMessageVO);
        System.out.println(serverMessage);
        ServerMessageVO messageVO = JSON.parseObject(serverMessage, ServerMessageVO.class);
        System.out.println(messageVO);
    }
}
